<?php

namespace app\model\store;


use app\model\site\User;
use think\Model;

class OrderRefund extends Model
{
    // 不能使用order关键字，所以用saleOrder
    public function saleOrder(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(Order::class, 'order_id');
    }

    public function user(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(User::class, 'user_id');
    }

    public function items(): \think\model\relation\HasMany
    {
        return $this->hasMany(OrderRefundItem::class, 'order_refund_id');
    }
}
